using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using ALex.Analizor;

                        namespace AnalizorSintactic
                        { 
                            class Program
                        {
                            private static Scaner scaner = new Scaner();
                            private static AtomLexical atomLexical;
                            private static bool eof;

                            static void Main(string[] args)
                            {
                                
                        try
                        {
                            Scaner scaner = new Scaner();
                            string fisierSursa="F:\\CSharp\\Tema4\\Generator\\Form1.cs";
                            scaner.daFisierSursa(fisierSursa);

                            bool eof = false;

                        
Prog();}
catch(Exception exp){
Console.WriteLine(exp.ToString());
}
}
public static void Prog()
{Stmts();
if(atomLexical.tipAtom == Tokens.PUNCTUATOR)
{
atomLexical=scaner.nextToken(out eof);
if(eof==true)
{
 atomLexical=}
}
 else 
 throw new Exception("Eroare");
}
public static void Stmt()
{if(atomLexical.tipAtom == Tokens.KEYWORD)
{
atomLexical=scaner.nextToken(out eof);
if(eof==true)
{
 atomLexical=}
if(atomLexical.tipAtom == Tokens.OPERATOR)
{
atomLexical=scaner.nextToken(out eof);
if(eof==true)
{
 atomLexical=}
Expr();
if(atomLexical.tipAtom == Tokens.OPERATOR)
{
atomLexical=scaner.nextToken(out eof);
if(eof==true)
{
 atomLexical=}
Stmt();
}
 else 
 throw new Exception("Eroare");
}
 else 
 throw new Exception("Eroare");
}
 else 
 throw new Exception("Eroare");
}
public static void Expr()
{if(atomLexical.tipAtom == Tokens.IDENTIFIER)
{
atomLexical=scaner.nextToken(out eof);
if(eof==true)
{
 atomLexical=}
Etail();
}
 else 
 throw new Exception("Eroare");
}
public static void Etail()
{if(atomLexical.tipAtom == Tokens.OPERATOR)
{
atomLexical=scaner.nextToken(out eof);
if(eof==true)
{
 atomLexical=}
Expr();
}
 else 
 throw new Exception("Eroare");
if(atomLexical.tipAtom == Tokens.PUNCTUATOR)
{
atomLexical=scaner.nextToken(out eof);
if(eof==true)
{
 atomLexical=}
Expr();
}
 else 
 throw new Exception("Eroare");
}

}
}